package com.againstsky.algorithm;

import com.againstsky.ABag;
import com.againstsky.algorithm.bean.SortBase;
import com.againstsky.algorithm.sort.*;
import edu.princeton.cs.algs4.In;
import edu.princeton.cs.algs4.StdDraw;
import edu.princeton.cs.algs4.StdOut;

import java.io.*;
import java.util.*;

/**
 * Created by agasinst on 2017/8/25.
 */
public class TestMain {

    private static int l=10000000,m=1000000;

    private static SortBase sortBase=new DownTopMergeSort();

    private static  Random random=new Random();

    private static Integer a[]=new Integer[l];

    private static Set<Integer> whitelistSet=new HashSet<>(l);

    public static void main(String[] args) throws IOException {
        for (int i = 0; i < a.length; i++) {
            a[i]=random.nextInt(l*100);
        }
        System.out.println("begin sort");
        long time=System.currentTimeMillis();
        sortBase.sort(a);
        System.out.println("sort time:"+(System.currentTimeMillis()-time));
//        for (int i = 0; i < a.length; i++) {
//            System.out.print(a[i]+",");
//        }
    }
}
